package ru.amse.baltijsky.javascheme.tree.walker;

import ru.amse.baltijsky.javascheme.node.INode;

/**
 * A step-by-step walker for the schema tree. For each step returns information about
 * the new state it has proceeded to.
 * <p/>
 * The parametrization ensures that we walk only over the certain type of nodes, say, schema tree nodes and not
 * layout nodes.
 */
public interface ITreeWalker<T extends INode<T>> {
    /**
     * Resets current node to the root of the schema tree.
     */
    void reset();

    /**
     * Indicates whether the walker can proceed to the next state.
     *
     * @return <code>true</code> iff there are unread-yet nodes in the current loadTree tree.
     */
    boolean hasNextState();

    /**
     * Returns the next state in the loadTree tree traversal.
     *
     * @return the next state in the loadTree tree traversal
     */
    TraversalState<T> getNextState();
}
